In a database system, multiple jobs, or processes typically run simultaneously. A database likely contains many records, and processes operating on the database may require access to the records. There may also be instances in which multiple processes require access to a single record. Some forms of access to records, such as basic read operations, do not require an acting process to lock the record on which it is operating. Other forms of access, however, such as typical write operations, may require a process to exclude other processes from performing operations on the accessed record. The database system may implement a locking mechanism to enable processes to lock a shared resource while certain operations are performed on the locked resource.
While locking can be beneficial in computing environments where multiple processes run simultaneously on a set of resources, locking may sometimes lead to inefficiencies. For example, a first process may be required to wait for a second process to complete a task on a locked shared resource. While waiting, the first process may repeatedly check the availability of the shared resource until the shared resource becomes available again. As a result, processor power is used inefficiently to ensure that the second process can proceed as soon as possible.
A database system may be constructed such that, if a process waits too long for a particular resource, that process is automatically terminated. This termination can conserve computing power by reducing the repetitive checking that occurs while the process waits for the shared resource. As an unfortunate result, when the desired resource is available, the ceased process is no longer running, although it could conceivably access the resource. In conventional database systems, a database administrator may be required to manually restart the terminated process, so that the process can continue its tasks.
Manually restarting processes, however, can lead to some undesirable results. For example, manual restart allows for human error in restarting a process. Additionally, manual restart will likely not occur immediately after the desired resource becomes available and, as a result, the system is not as efficient as desired.
Accordingly, there is a need for systems and methods for sensing when a process has ended, and for automatically restarting such process. It is such systems and methods to which various embodiments of the present invention are directed.